class LocalCache {
    //保存
    setCache(key, value) {
      window.localStorage.setItem(key, JSON.stringify(value))
    }
    //获取
    getCache(key) {
      const value = window.localStorage.getItem(key)
      if (value) {
        return JSON.parse(value)
      }
    }
    //全部清除
    clearCache() {
      window.localStorage.clear()
    }
    //移除某一个
    removeCache(key) {
      window.localStorage.removeItem(key)
    }
    userinfo () {
      const industry = this.getCache('industry')
      const name = this.getCache('name')
      const phone = this.getCache("phone")
      const id = this.getCache("id")
      return {id,name,industry,phone}
    }
  }
  export default new LocalCache()